package com.google.code.netbuilder.dal.entities;

import java.io.Serializable;
import java.util.Date;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.persistence.*;

/**
 *
 * 
 */
@XmlType(propOrder = {"id", "type", "isBroken", "numberOfPorts"}, 
                         name = "Cable")
@XmlAccessorType(XmlAccessType.FIELD)
@Entity
@Table(name = "cable")
@SequenceGenerator(name="seq", initialValue=1, allocationSize=100)
public class Cable implements Serializable {

        @Id
        @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq")
	Integer id;
	String type;
	int isBroken;
        @Column(name="number_of_wires")
	Integer numberOfWires;
        @Temporal(javax.persistence.TemporalType.DATE)
	Date date;
	
	public Date getDate() {
		return date;
	}

	public void setDate(long millisecond) {
		this.date = new Date(millisecond);
	}
	
	public void setDate(Date date) {
		this.date = date;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public int getIsBroken() {
		return isBroken;
	}

	public void setIsBroken(int isBroken) {
		this.isBroken = isBroken;
	}

	public Integer getNumberOfWires() {
		return numberOfWires;
	}

	public void setNumberOfWires(Integer numberOfPorts) {
		this.numberOfWires = numberOfPorts;
	}

}
